<template>
	<scroll-view scroll-y="true" class="team" @scrolltolower="lower()">
		<view class="list" v-for="(item,index) of list">
			<view class="info">
				<view class="l">提现金额</view>
				<view class="r">{{item.num}}元</view>
			</view>
			<view class="info">
				<view class="l">审核状态</view>
				<view class="r" v-if="item.status === 0">待审核</view>
				<view class="r" v-else-if="item.status === 1">审核通过</view>
				<view class="r" v-else-if="item.status === -1">审核拒绝</view>
			</view>
			<view class="info">
				<view class="l">手续费</view>
				<view class="r">{{item.num - item.actual_num}}元</view>
			</view>
			<view class="info">
				<view class="l">申请时间</view>
				<view class="r">{{item.createtime | date('yyyy年mm月dd日 hh时MM分')}}</view>
			</view>
		</view>
	</scroll-view>
</template>

<script>
	export default {
		data() {
			return {
				page: 1,
				finish: false,
				type: '',
				list: []
			};
		},
		onLoad(options) {
			console.log(options)
			this.type = options.type
			this.getList()
		},
		methods: {
			lower() {
				this.page++
				this.getList()
			},
			getList() {
				if (this.finish) {
					return
				}
				uni.$u.http.post('/withdraw', {
					types: 'list',
					page: this.page,
					type: this.type
				}).then(res => {
					if (res.code == 1) {
						this.list = this.list.concat(res.data)
						if (res.data.length === 0) {
							this.finish = true
						}
					}
				}).catch((res) => {

				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.team {
		height: 100vh;
		background: #F6F6F6;

		.list {
			background: #fff;
			padding: 27rpx;
			margin-bottom: 20rpx;

			.info {
				display: flex;
				align-items: center;
				justify-content: space-between;
				margin-bottom: 10rpx;

				.l {
					font-size: 28rpx;
					color: #666;
				}

				.r {
					font-size: 28rpx;
					color: #333;
				}
			}
		}
	}
</style>
